package com.pet.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;

/**
 * 公告
 * @TableName pet_notice
 */
@TableName(value ="pet_notice")
@Data
public class PetNotice implements Serializable {
    /**
     * 公告id
     */
    @TableId(value = "notice_id", type = IdType.AUTO)
    private Integer notice_id;

    /**
     * 公告名称
     */
    @TableField(value = "notice_name")
    private String notice_name;

    /**
     * 公告内容
     */
    @TableField(value = "notice_content")
    private String notice_content;

    /**
     * 公告发布时间
     */
    @TableField(value = "notice_time")
    private LocalDateTime notice_time;

    /**
     * 删除状态：0未删除，1已删除
     */
    @TableField(value = "notice_delete")
    private String notice_delete;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PetNotice other = (PetNotice) that;
        return (this.getNotice_id() == null ? other.getNotice_id() == null : this.getNotice_id().equals(other.getNotice_id()))
            && (this.getNotice_name() == null ? other.getNotice_name() == null : this.getNotice_name().equals(other.getNotice_name()))
            && (this.getNotice_content() == null ? other.getNotice_content() == null : this.getNotice_content().equals(other.getNotice_content()))
            && (this.getNotice_time() == null ? other.getNotice_time() == null : this.getNotice_time().equals(other.getNotice_time()))
            && (this.getNotice_delete() == null ? other.getNotice_delete() == null : this.getNotice_delete().equals(other.getNotice_delete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getNotice_id() == null) ? 0 : getNotice_id().hashCode());
        result = prime * result + ((getNotice_name() == null) ? 0 : getNotice_name().hashCode());
        result = prime * result + ((getNotice_content() == null) ? 0 : getNotice_content().hashCode());
        result = prime * result + ((getNotice_time() == null) ? 0 : getNotice_time().hashCode());
        result = prime * result + ((getNotice_delete() == null) ? 0 : getNotice_delete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", notice_id=").append(notice_id);
        sb.append(", notice_name=").append(notice_name);
        sb.append(", notice_content=").append(notice_content);
        sb.append(", notice_time=").append(notice_time);
        sb.append(", notice_delete=").append(notice_delete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}